 $(function(){
     //音乐
// 音乐
    var mid = document.getElementById('music');
    $('#audio_btn').click(function(){
        if($(this).hasClass("off"))
        {   
            mid.play();
            $(this).addClass("play_yinfu").removeClass("off");
            $("#yinfu").addClass("rotate");    
        }
        else
        {            
            mid.pause();
            $("#audio_btn").addClass("off").removeClass("play_yinfu")
            $("#yinfu").removeClass("rotate");
        }
    })
  
  function audioAutoPlay(id){
    var audio = document.getElementById(id),
    play = function(){
        audio.play();
        document.removeEventListener("touchstart",play, false);
    };
    audio.play();
    document.addEventListener("WeixinJSBridgeReady", function () {//微信
       play();
    }, false);
    document.addEventListener("touchstart",play, false);
   }
audioAutoPlay('music');
 })
